package com.soundking.server.init;

import com.soundking.server.service.WxWorkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author Li Jiahui
 * @version V1.0
 * @Date 2024/1/25
 **/
@Component
public class ScheduleTaskExecuteUtil {
    @Autowired
    private WxWorkService wxWorkService;

    @Async
    @Scheduled(cron = "0 0 */2 * * ?")
    public void refreshWeixinAccessToken(){
        wxWorkService.refreshAccessToken();
    }
}
